import Person from "../practice_10/person.js";

class Teacher extends Person{
    constructor(id,name,age,klasses=[]){
        super(id,name,age);
        this.klasses = klasses;
    }
    introduce(){
        if(this.klasses.length == 0){
            return `${super.introduce()} I am a Teacher. I teach No Class.`
        }else{
            let arr = [];
            for(let item of this.klasses){
                arr.push(item.number);
            }
            return `${super.introduce()} I am a Teacher. I teach Class ${arr.toString()}.`
        }
    }
    isTeaching(student){
        for(let klass of this.klasses){
            if(klass.isIn(student)){
                return true;
            }else{
                return false;
            }
        }

    }
}
export default Teacher;

